package org.TCPdemo;

import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket=new ServerSocket(10086);
        Socket accept = serverSocket.accept();
        InputStream inputStream = accept.getInputStream();
        int data=0;
        while ((data=inputStream.read())!=-1){
            System.out.println((char) data);
        }
        inputStream.close();
        accept.close();
        serverSocket.close();
    }
}
